//
//  SwiftUI_DemoVC.swift
//  APSwift
//
//  Created by jianbo.pei on 2023/11/2.
//

import UIKit
import SwiftUI

class SwiftUI_DemoVC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        _ = UIButton(type: .custom).then({ make in
            view.addSubview(make)
            make.backgroundColor = .lightGray
            make.setTitle("SwiftUI 示例s", for: .normal)
            make.snp.makeConstraints { make in
                make.size.equalTo(CGSize(width: 200, height: 60))
                make.center.equalToSuperview()
            }
            make.addTarget(self, action: #selector(tapAction), for: .touchUpInside)
        })
    }

    @objc private func tapAction() {
        let vc = UIHostingController(rootView: Charts_DemoView())
        navigationController?.pushViewController(vc, animated: true)
    }


}
